package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="market_coupon" )
public class MarketCoupon extends BaseObject implements Serializable {
    private Long couponId;
    private Long adminId;
    private String couponKey;
    private String couponName;
    private Long couponPoint;
    private String couponPrefix;
    private Long couponQuantity;
    private byte couponStatus;
    private byte couponType;
    private Long createTime;

    @Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getCouponId() {
        return this.couponId;
    }
    
    public void setCouponId(Long couponId) {
        this.couponId = couponId;
    }
    
    @Column(name="admin_id", nullable=false)
    public Long getAdminId() {
        return this.adminId;
    }
    
    public void setAdminId(Long adminId) {
        this.adminId = adminId;
    }
    
    @Column(name="coupon_key", nullable=false, length=20)
    public String getCouponKey() {
        return this.couponKey;
    }
    
    public void setCouponKey(String couponKey) {
        this.couponKey = couponKey;
    }
    
    @Column(name="coupon_name", nullable=false)
    public String getCouponName() {
        return this.couponName;
    }
    
    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }
    
    @Column(name="coupon_point", nullable=false)
    public Long getCouponPoint() {
        return this.couponPoint;
    }
    
    public void setCouponPoint(Long couponPoint) {
        this.couponPoint = couponPoint;
    }
    
    @Column(name="coupon_prefix", nullable=false, length=50)
    public String getCouponPrefix() {
        return this.couponPrefix;
    }
    
    public void setCouponPrefix(String couponPrefix) {
        this.couponPrefix = couponPrefix;
    }
    
    @Column(name="coupon_quantity", nullable=false)
    public Long getCouponQuantity() {
        return this.couponQuantity;
    }
    
    public void setCouponQuantity(Long couponQuantity) {
        this.couponQuantity = couponQuantity;
    }
    
    @Column(name="coupon_status", nullable=false)
    public byte getCouponStatus() {
        return this.couponStatus;
    }
    
    public void setCouponStatus(byte couponStatus) {
        this.couponStatus = couponStatus;
    }
    
    @Column(name="coupon_type", nullable=false)
    public byte getCouponType() {
        return this.couponType;
    }
    
    public void setCouponType(byte couponType) {
        this.couponType = couponType;
    }
    
    @Column(name="create_time", nullable=false)
    public Long getCreateTime() {
        return this.createTime;
    }
    
    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MarketCoupon pojo = (MarketCoupon) o;

        if (adminId != null ? !adminId.equals(pojo.adminId) : pojo.adminId != null) return false;
        if (couponKey != null ? !couponKey.equals(pojo.couponKey) : pojo.couponKey != null) return false;
        if (couponName != null ? !couponName.equals(pojo.couponName) : pojo.couponName != null) return false;
        if (couponPoint != null ? !couponPoint.equals(pojo.couponPoint) : pojo.couponPoint != null) return false;
        if (couponPrefix != null ? !couponPrefix.equals(pojo.couponPrefix) : pojo.couponPrefix != null) return false;
        if (couponQuantity != null ? !couponQuantity.equals(pojo.couponQuantity) : pojo.couponQuantity != null) return false;
         if (createTime != null ? !createTime.equals(pojo.createTime) : pojo.createTime != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (adminId != null ? adminId.hashCode() : 0);
        result = 31 * result + (couponKey != null ? couponKey.hashCode() : 0);
        result = 31 * result + (couponName != null ? couponName.hashCode() : 0);
        result = 31 * result + (couponPoint != null ? couponPoint.hashCode() : 0);
        result = 31 * result + (couponPrefix != null ? couponPrefix.hashCode() : 0);
        result = 31 * result + (couponQuantity != null ? couponQuantity.hashCode() : 0);
         result = 31 * result + (createTime != null ? createTime.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("couponId").append("='").append(getCouponId()).append("', ");
        sb.append("adminId").append("='").append(getAdminId()).append("', ");
        sb.append("couponKey").append("='").append(getCouponKey()).append("', ");
        sb.append("couponName").append("='").append(getCouponName()).append("', ");
        sb.append("couponPoint").append("='").append(getCouponPoint()).append("', ");
        sb.append("couponPrefix").append("='").append(getCouponPrefix()).append("', ");
        sb.append("couponQuantity").append("='").append(getCouponQuantity()).append("', ");
        sb.append("couponStatus").append("='").append(getCouponStatus()).append("', ");
        sb.append("couponType").append("='").append(getCouponType()).append("', ");
        sb.append("createTime").append("='").append(getCreateTime()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
